Fix Config.mk's cc-option for -Wno-* options.
authorKeir Fraser <keir@xen.org>
Mon, 23 May 2011 16:38:28 +0000 (17:38 +0100)
committerKeir Fraser <keir@xen.org>
Mon, 23 May 2011 16:38:28 +0000 (17:38 +0100)
commit28f8fb7d2b3fde2f5cbe5526ac4f1c932e3f5d26
tree6cab52be55a7f2c38f5a4719f6dc94ec9e47b6e7
parent5a40af4739c1402ada1a8668c1a08c4ce6a1628f
Fix Config.mk's cc-option for -Wno-* options.

These disable-warning options are handled specially by GCC:
 (a) they are ignored unless the compiler emits a warning; and
 (b) even then they produce a warning rather than an error

To handle this, modify the test invocation of GCC to compile a
fragment of code that will always provoke a warning (integer assigned
to pointer). This works around (a) above.

Then, we grep the compiler's stdout/stderr for the option-under-test,
the presence of which would indicate an "unrecognized command-line
option" warning/error. This works around (b) above, letting us
distinguish between the "integer assigned to pointer" and
"unrecognized command-line option" warnings.

Signed-off-by: Keir Fraser <keir@xen.org>
Config.mk